package com.sugar.follow.up.module.business.dal.mysql.patientnfmzl;

import com.sugar.follow.up.framework.common.pojo.PageResult;
import com.sugar.follow.up.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.sugar.follow.up.framework.mybatis.core.mapper.BaseMapperX;
import com.sugar.follow.up.module.business.dal.dataobject.patientnfmzl.PatientNfmzlDO;
import org.apache.ibatis.annotations.Mapper;
import com.sugar.follow.up.module.business.controller.admin.patient.nfmzl.vo.*;

/**
 * 内分泌治疗 Mapper
 *
 * @author Ysugar
 */
@Mapper
public interface PatientNfmzlMapper extends BaseMapperX<PatientNfmzlDO> {

    default PageResult<PatientNfmzlDO> selectPage(PatientNfmzlPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PatientNfmzlDO>()
                .eqIfPresent(PatientNfmzlDO::getPatientId, reqVO.getPatientId())
                .likeIfPresent(PatientNfmzlDO::getPatientName, reqVO.getPatientName())
                .eqIfPresent(PatientNfmzlDO::getDoctorId, reqVO.getDoctorId())
                .likeIfPresent(PatientNfmzlDO::getDoctorName, reqVO.getDoctorName())
                .betweenIfPresent(PatientNfmzlDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PatientNfmzlDO::getId));
    }

}